home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 06 - 1990 / 06.02 Feb 90 / Bit Mapper Source / BTMP2 / BitMapperRsrc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-19  |  3.0 KB  |  126 lines  |  [TEXT/KAHL]

  1. /* ======================================= *
  2.     file:    BitMapperRsrc.h
  3.     version:    2
  4.     date:    11.17.89
  5.  * --------------------------------------- *
  6.     Header file for C and Rez for the
  7.     BitMapper SuperPaint plug-in tool.
  8.     Contains symbolic constants, data type
  9.     and resource type definitions that are
  10.     common to both the C and Rez components
  11.     of the project.  Utilizes the Rez
  12.     compiler symbol, “REZ”, to conditionally
  13.     include/exclude definition lines as
  14.     necessary.
  15.  * --------------------------------------- *
  16.     Copyright © 1989, Michael Ogawa and
  17.     MacTutor — All Rights Reserved.
  18.  * ======================================= */
  19.  
  20. #ifndef _H_BitMapperRsrc
  21. #define _H_BitMapperRsrc
  22.  
  23. #ifdef REZ
  24. #    ifndef bold
  25. #        include "Types.r"
  26. #        include "SysTypes.r"
  27. #    endif bold
  28. #endif REZ
  29.  
  30.  
  31. /* constants ============================= */
  32.  
  33. #define kOrigBaseID        16000
  34. /*    All resources of plug-in tools should be
  35. numbered consecutively from a base resource
  36. ID.  This is the ID# we are using as our base
  37. ID. */
  38. /*    m_o 09.13.89 */
  39.  
  40.  
  41. #define kType_BitMap    'BTMP'
  42. /*    Resource type of our custom bitmap and
  43. image resource that we create with
  44. BitMapper. */
  45. /*    m_o 09.13.89 */
  46.  
  47.  
  48. #define kALRT_Err    0        /* + baseID */
  49. #define kDITL_Err    kALRT_Err    /* + baseID */
  50. #define kactb_Err    kALRT_Err    /* + baseID */
  51. /*    ID offsets for the error alert
  52. resources, based off of the base resource ID.
  53. The resources are Rez compiled with these
  54. resource IDs plus kOrigBaseID.  They are
  55. calculated at runtime based on the value in
  56. the toolID field of the menu command data
  57. record that is passed in to our tool. */
  58. /*    m_o 09.17.89 */
  59.  
  60.  
  61. #define kMENU_BitMapper        200
  62. #ifndef REZ
  63. enum {
  64.     kMITEM_BTMP    = 1,        /* BTMP */
  65.     kMITEM_BTMN            /* BTM# */
  66. };
  67. #endif REZ
  68. /*    Menu ID and item numbers for our
  69. sub-menu.  Menu IDs in the range of 0-235
  70. are reserved for applications to use for
  71. sub-menus, SuperPaint reserves the sub-range
  72. of 200-235 for plug-ins. */
  73. /*    m_o 11.13.89 */
  74.  
  75.  
  76. /* data types ============================ */
  77.  
  78. #ifndef REZ
  79. typedef struct {
  80.     BitMap    map;
  81.     short    image[];        
  82. } TBTMP, *TBTMPPeek, **TBTMPPkHndl;
  83. typedef BitMap    *TBTMPPtr, **TBTMPHndl;
  84. #else
  85. type kType_BitMap {
  86.     unsigned longint = 0; /* map.baseAddr */
  87.     integer;            /* map.rowBytes */
  88.     rect;            /* map.bounds */
  89.     hex string;        /* image */
  90. };
  91. #endif REZ
  92. /*    Data structure for our custom bitmap and
  93. image resource type. */
  94. /*    mps 06.22.89/m_o 06.25.89 */
  95.  
  96.  
  97. #ifndef REZ
  98. typedef struct {
  99.     short    szEntry;
  100.     TBTMP    theBTMP;
  101. } TBTMNEntry, *TBTMNEntryPtr;
  102. #endif REZ
  103. /*    An entry in the 'BTM#' resource data
  104. type consists of a field containing the size
  105. of the entry in bytes, followed by the 'BTMP'
  106. resource data.
  107.     Note that you may want to change the
  108. szEntry field to type Size to deal with very
  109. large bit images. */
  110. /*    mps 06.22.89/m_o 11.17.89 */
  111.  
  112.  
  113. #ifndef REZ
  114. typedef struct {
  115.     short        count;
  116.     TBTMNEntry    theBTMNEntries[];
  117. } *TBMPN, *TBTMNPtr, **TBTMNHndl;
  118. #endif REZ
  119. /*    The 'BTM#' resource data type consists
  120. of a field indicating the number of entries
  121. in the resource, followed by the entries. */
  122. /*    mps 06.22.89/m_o 11.13.89 */
  123.  
  124.  
  125. #endif _H_BitMapperRsrc
  126.